# Dreams have to come true after all
# 交易模块下的蓝图，包括交易模块的所有资源
from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json

transaction_bp = Blueprint('transaction', __name__, url_prefix='/transaction')  # 创建蓝图
transaction_api = Api(transaction_bp)  # 创建蓝图中的资源API

# 使用我们自定义json格式，替代装饰器的写法
transaction_api.representation('application/json')(output_json)

# 加载当前模块的资源

from Financial.resource.transaction.invest_resource import Invest
from Financial.resource.transaction.deal_record_resource import Deal_record

# 加载当前模块的资源

transaction_api.add_resource(Invest, '/invest_record', endpoint='invest_record')   # 投资记录
transaction_api.add_resource(Deal_record, '/deal_record', endpoint='deal_record')  # 交易记录